<?php
namespace common\models;

use Yii;

/**
 * This is the model class for table "column".
 *
 * @property integer $id
 * @property string $name
 * @property integer $pid
 */
class Column extends \yii\db\ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'column';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [
                [
                    'name',
                    'pid'
                ],
                'required'
            ],
            [
                [
                    'pid'
                ],
                'integer'
            ],
            [
                [
                    'name'
                ],
                'string',
                'max' => 10
            ],
            ['message','string','max'=>80]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '栏目名',
            'pid' => '上级栏目',
            'message'=>'简介'
        ];
    }
}
